<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>资讯详情页</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<meta name="format-detection" content="telephone=no, email=no" />
<link rel="stylesheet" href="{{ url('/common/mobile-common/common.css') }}">	
<link rel="stylesheet" href="{{ url('/mobile/css/article/article-detail.css') }}">	
<script src="{{ url('mobile/js/jquery-1.8.3.min.js') }}"></script>
<script src="{{ url('mobile/js/iscroll-probe.js') }}"></script>
<script src="{{ url('/common/mobile-common/hmt.js') }}"></script>
 <!--<script>
		 var myscroll;
		function loaded(){
			myscroll=new iScroll("wrapper");
		}
		 window.addEventListener("load",loaded,false);
 </script>-->
 <script type="text/javascript">
     var myScroll;
     function loaded () {
	   myScroll = new IScroll('#wrapper', {
	 	 mouseWheel: true,
	 	 scrollX: true,
	 	 freeScroll: false,
	 	 click:true

	   });
     }

     document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

</script>
</head>
<body onload="loaded()"> 
	<div id="wrapper">
        <div id="scroller">
	<div class="abouts">
		<ul>
			<li>
				<div class="wrap-cont clearfix">
				<!--消息详情-->
				<div class="wrap-cont">
					<div class="cont-top">
						<h3>{{$res->title}}</h3>
						<p class="clearfix">
							<span>{{$res->from}}</span>
							<span class="author">{{$res->author}}</span>
							<em>{{App\Http\Util\TimeHelper::formatDate($res->created_at)}}</em>
						</p>
					</div>
					<div class="cont-txt">
						{!! html_entity_decode($res->content) !!}
					</div>
				</div>
				<!--end-->
				<!--评论-->
				<div class="comment-cont">
					<div class="comm-tit">
						<h3><span>评论</span><em><i>{{count($comments)}}</i>条</em></h3>
					</div>
					@foreach($comments as $v)
					<div class="comm-info">
						<p class="yh-info">
							<span>
								@if(!empty($v->avatar))
									<img src="{{$v->avatar}}">
								@else
									<img src="{{ url('web/images/pl.png') }}">
								@endif
							</span>
							<em>{{$v->nickname?$v->nickname:$v->account}}</em>
							<i>{{\App\Http\Util\TimeHelper::formatDateTime($v->created_at)}}</i>
						</p>
						<p class="comm-txt">
							{{$v->content}}
						</p>
						<a class="see-more" href="javascript:void(0)">查看更多</a>
					</div>
					@endforeach
				</div>				
			</div>		
			</li>
		</ul>
				
	</div>
		</div>	
		</div>
		<!--</article>-->
		<!--发表评论-->
		<div class="foot" id='footer'>
			<div class="edit-comm">
				<p>
					<form method="post" action="{{url('wap/articleDetail/'.$res->id)}}">
					<input type="text" value="请输入评论内容" name="content" onfocus="{value=''}" class="pltxt">
					<button class="fb" type="submit">发表</button>
					</form>
				</p>
			</div>
		</div>
		<!--end-->
	</div>
	
</body>
<script>
	$(function(){

		
		$(".see-more").hide();
		$(".fb").click(function(){
				var plTxt=$.trim($(".pltxt").val());
				if(plTxt=="请输入评论内容" || plTxt==''){
				alert("请输入评论内容");
				return false;
			}	
		});
		
		$(window).resize(function() {
			     myScroll.refresh();
			
		});
//		$(".pltxt").blur(function(){
//			
//		});
			
		
			//资讯列表文字个数限制
			$(".comm-info .comm-txt").each(function(){
                var txtLegth=$(this).text().length;
                var txtInfo=$(this).text();
                var nowInfo=txtInfo.substr(0, 126);
                if(txtLegth>126){
                    nowInfo+='...';
                    $(this).parent().find(".see-more").show();
                    $(".see-more").click(function(){
                    	$(this).parent().find(".comm-txt").text(txtInfo);
                    	$(this).hide();
                    })
                }
                $(this).text(nowInfo);
            });
	});
</script>
</html>
